package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerAttendanceStatisticsMapper;
import com.traffic.domain.PerAttendanceStatistics;
import com.traffic.service.IPerAttendanceStatisticsService;

/**
 * 出勤统计Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerAttendanceStatisticsServiceImpl implements IPerAttendanceStatisticsService 
{
    @Autowired
    private PerAttendanceStatisticsMapper perAttendanceStatisticsMapper;

    /**
     * 查询出勤统计
     * 
     * @param statsId 出勤统计主键
     * @return 出勤统计
     */
    @Override
    public PerAttendanceStatistics selectPerAttendanceStatisticsByStatsId(Long statsId)
    {
        return perAttendanceStatisticsMapper.selectPerAttendanceStatisticsByStatsId(statsId);
    }

    /**
     * 查询出勤统计列表
     * 
     * @param perAttendanceStatistics 出勤统计
     * @return 出勤统计
     */
    @Override
    public List<PerAttendanceStatistics> selectPerAttendanceStatisticsList(PerAttendanceStatistics perAttendanceStatistics)
    {
        return perAttendanceStatisticsMapper.selectPerAttendanceStatisticsList(perAttendanceStatistics);
    }

    /**
     * 新增出勤统计
     * 
     * @param perAttendanceStatistics 出勤统计
     * @return 结果
     */
    @Override
    public int insertPerAttendanceStatistics(PerAttendanceStatistics perAttendanceStatistics)
    {
        return perAttendanceStatisticsMapper.insertPerAttendanceStatistics(perAttendanceStatistics);
    }

    /**
     * 修改出勤统计
     * 
     * @param perAttendanceStatistics 出勤统计
     * @return 结果
     */
    @Override
    public int updatePerAttendanceStatistics(PerAttendanceStatistics perAttendanceStatistics)
    {
        perAttendanceStatistics.setUpdateTime(DateUtils.getNowDate());
        return perAttendanceStatisticsMapper.updatePerAttendanceStatistics(perAttendanceStatistics);
    }

    /**
     * 批量删除出勤统计
     * 
     * @param statsIds 需要删除的出勤统计主键
     * @return 结果
     */
    @Override
    public int deletePerAttendanceStatisticsByStatsIds(Long[] statsIds)
    {
        return perAttendanceStatisticsMapper.deletePerAttendanceStatisticsByStatsIds(statsIds);
    }

    /**
     * 删除出勤统计信息
     * 
     * @param statsId 出勤统计主键
     * @return 结果
     */
    @Override
    public int deletePerAttendanceStatisticsByStatsId(Long statsId)
    {
        return perAttendanceStatisticsMapper.deletePerAttendanceStatisticsByStatsId(statsId);
    }
}
